package com.sunwayworld.basemodule.coredata.test.resource.impl;

import com.sunwayworld.framework.restful.data.RestValidationResultBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.sunwayworld.basemodule.coredata.test.resource.LimsTestSupplementResource;
import com.sunwayworld.basemodule.coredata.test.service.LimsTestSupplementService;
import com.sunwayworld.framework.spring.annotation.GikamBean;
import com.sunwayworld.framework.log.annotation.Log;
import com.sunwayworld.framework.log.annotation.LogModule;
import com.sunwayworld.framework.log.annotation.LogType;
import com.sunwayworld.framework.restful.data.RestJsonWrapperBean;

@LogModule("工序补充信息")
@RestController
@GikamBean
public class LimsTestSupplementResourceImpl implements LimsTestSupplementResource {

    @Autowired
    private LimsTestSupplementService limsTestSupplementService;

    @Override
    public LimsTestSupplementService getService() {
        return limsTestSupplementService;
    }

    @Log(value = "新增工序补充信息", type = LogType.INSERT)
    @Override
    @RequestMapping(method = RequestMethod.POST)
    public Long insert(RestJsonWrapperBean wrapper) {
        return getService().insert(wrapper);
    }

    @Override
    public RestValidationResultBean validateUniqueByTest(Long testId, RestJsonWrapperBean wrapper) {
        return limsTestSupplementService.validateUniqueByTest(testId, wrapper);
    }
}
